#ifndef TRANSFORMERCONTENTTHREADS_HPP_3
#define TRANSFORMERCONTENTTHREADS_HPP_3
#include "transContentDefine.h"
#include "transContentErrorCode.h"
#include "transContentSetting.hpp"
#include "logger.hpp"


#include "transContentPortMgr.hpp"
#include "transContentDispatcher.hpp"

//////////////////////////////////////////////
/// current thread pool jut intend to only support dispatcher receive mthod
/// so when thread pool start, block at the read method
/// any other method now create a new method instead,
/// must modify this next version
//////////////////////////////////////////////
class TransContentDispatcherThreads{
	private:
		int mCount;
		int mState;
		int capacity;
		pthread_t* mThreadPool;
		static TransContentDispatcherThreads* _instance;
	public:
		static TransContentDispatcherThreads* getInstance();
		static void releaseInstance();

		int getThreadCount(){
			return this->mCount;
		}

		int getThreadCapacity(){
			return this->capacity;
		}

		int getState(){
			return this->mState;
		}


	private:
		TransContentDispatcherThreads();
		~TransContentDispatcherThreads();
		int createThreads();
		void closeAllThreads();
		static void* startRun(void* p);
};
#endif //TRANSFORMERCONTENTTHREADS_HPP_3
